package com.dmlll.controller;

import com.dmlll.pojo.DwellMessage;
import com.dmlll.service.DwellMessageService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DwellMessageController {

    @Autowired
    private DwellMessageService dwellMessageService;

    @RequestMapping("/insertDwellMessage")
    @ResponseBody
    public int insertDwellMessage(DwellMessage dwellMessage){
        if(dwellMessage.getId()==null) {
            dwellMessageService.insertDwellMessage(dwellMessage);
        }else {
            dwellMessageService.updateDwellMessage(dwellMessage);
        }
        return dwellMessage.getId();
    }
    @RequestMapping("findDwellMessageById")
    @ResponseBody
    public DwellMessage findDwellMessageById(Integer id){
        return dwellMessageService.findDwellMessageById(id);
    }
}
